# -*- coding: utf-8 -*-  
'''
关系集合

@author: luoyi
Created on 2021年6月22日
'''
import pickle

import utils.conf as conf


#    关系 <-> 编码
rel_id = {}
#    编码 <-> 关系
id_rel = {}


#    加载外部关系集合
def load_rel_id_from_pkl(pkl_path=conf.DATASET_BAIDU.get_rel_id_path()):
    global rel_id, id_rel
    with open(file=pkl_path, mode='rb') as fr:
        rel_id = pickle.load(fr)
        pass
    
    id_rel = {v:k for k,v in rel_id.items()}
    pass


